{include file=header.html}
<script type="text/javascript" src="index.php?act=jslang"></script>
<script language="javascript" type="text/javascript"
	src="{res file=js/jquery-1.2.6.js}"></script>
<script language="javascript" type="text/javascript"
	src="{res file=js/common.js}"></script>
<script language="javascript" type="text/javascript"
	src="{lib file=ajaxfileupload.js}"></script>
<script language="javascript" type="text/javascript"
	src="{res file=js/jquery.funkyUI.js}"></script>
<script language="JavaScript" type="text/javascript"
	src="{res file=js/lan.js}"></script>
<link href="template/style/css/style.css" type="text/css"
	rel="stylesheet" />
<style>
label.error {
	color: red;
}
.img_border{
	border: 2px solid #000000;width: 80px;height: 60px;
}
</style>
<script type="text/javascript">
//设为默认
function defaultImage(obj,id,sample_id) {
	$.ajax({
		url: 'index.php?app=sample&act=default_image&id=' + id + '&sample_id='+sample_id+'&ajax=1',
		type: 'GET',
		timeout: 1000,
		dataType:'json',
		error: function () {alert('网络连接错误，请稍后再试');},
		success: function (data) {
			if (data.done) {
				alert(data.msg);
				obj.parent().addClass('img_border').siblings().removeClass('img_border');
			}else{
				alert(data.msg);
			}
		}
	});
}
</script>
<body>
	<div class="sub-body">
		<div class="tab-frame" style="width: 900px;">
			<div class="tab-title-1">
				<span>{$lang.detail_thumb}</span>
			</div>
			<form id="thumb_form" method="post" enctype="multipart/form-data">
				<table width="100%" cellspacing="0" cellpadding="0" align="left"
					class="tab-display">
					<tbody>
						<tr>
							<th align="center" width="12%">{$lang.detail_thumb}：</th>
							<td align="left">
							<!-- {if $user.role==USER_CIVILIAN} -->
								<input type="button" class="btn-3" value="{$lang.upload_enclosure}" onClick="upload_docs({$belongs_sample_thumb},{$sample.sample_id});" /><br />
							<!-- {/if} -->
							</td>
						</tr>
						<tr>
							<td align="left" colspan="2" id="sample_thumb_img">
								<!--{foreach from=$sample.consumer_sample_thumb item=file}-->
								<div {if $sample.default_image eq $file.file_path}class="img_border"{/if} style="display: inline-block;">
								<img src="{$file.file_path}" title="点击设为默认" width="80px" height="60px" style="cursor: pointer;" <!-- {if $user.role==USER_CIVILIAN} --> onclick="defaultImage($(this),{$file.file_id},{$sample.sample_id})" <!-- {/if} --> />
						        </div>
						        <!-- {if $user.role==USER_CIVILIAN} -->
						        <a class="pic_del" style="color:blue"  href="{url app=comupload&act=delete&id=$file.file_id}" onClick="return confirm('{$lang.confirm_del_file}')" title="{$lang.delete}">&nbsp;</a>
								<!-- {/if} -->
								<!--{/foreach}-->
							</td>
						</tr>
						<tr>
							<td colspan="6">
								<input type="button" value="返 回" id="submit" class="btn-2" onclick="history.back();"/>
							</td>
						</tr>
					</tbody>
				</table>
			</form>
		</div>
	</div>
	<div id="remsg"></div>
</body>
</html>